package rtsp;

import utils.Consts;
import utils.ThreadPoolUtil;

import java.net.ServerSocket;
import java.net.Socket;

public class ConnectionAccepter {
    public static void main(String[] args){
        try{
            System.out.println("Listenning at port " + Consts.getProp("rtsp.listen"));
            ServerSocket serverSocket = new ServerSocket(Integer.parseInt(Consts.getProp("rtsp.listen")));
            while(true){
                Socket socket = serverSocket.accept();
                ThreadPoolUtil.fixedThreadPool.execute(new RTSPMainThread(socket));
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
